/* OpenStereo Library - A library to support the development of real time stereoscopic applications.
 * Copyright (C) 2007  Pedro Leite.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef sl_datatypes_h
#define sl_datatypes_h

#include <SL/sl.h>
#include <glib.h>
#include <gmodule.h>

typedef SLbool (SL_API_ENTRY *PFNSLLOADPLUGIN) (void);

typedef const char* (SL_API_ENTRY *PFNSLGETPLUGINNAME) (void);

typedef const char* (SL_API_ENTRY *PFNSLGETPLUGINDESCRIPTION) (void);

typedef SLStereoData (SL_API_ENTRY *PFNSLALLOCATESTEREODATA) (SLuint width,
	SLuint height);

typedef void (SL_API_ENTRY *PFNSLDESTROYSTEREODATA) (SLStereoData data);

typedef void (SL_API_ENTRY *PFNSLRENDERSTEREO) (SLViewport viewport,
	SLScene scene, SLStereoData data);

typedef void (SL_API_ENTRY *PFNSLUNLOADPLUGIN) (void);

struct _SLContext {
	GHashTable* plugins;
	GHashTable* viewports;
	SLbool initialized;
};

struct _SLPlugin {
	GModule* module;
	const char* name;
	const char* description;
	PFNSLLOADPLUGIN loadPlugin;
	PFNSLGETPLUGINNAME getPluginName;
	PFNSLGETPLUGINDESCRIPTION getPluginDescription;
	PFNSLALLOCATESTEREODATA allocateStereoData;
	PFNSLDESTROYSTEREODATA destroyStereoData;
	PFNSLRENDERSTEREO renderStereo;
	PFNSLUNLOADPLUGIN unloadPlugin;
};

struct _SLViewport {
	SLuint width;
	SLuint height;
	SLAnaglyphMethod method;
	SLCamera camera;
	SLScene scene;
	SLStereoData stereoData;
};

#endif
